import request from '@/utils/request'

export function processCompleted(params) {
  return request({
    url: '/trade/processCompleted',
    method: 'get',
    params,
  })
}

export function production(params) {
  return request({
    url: '/trade/production',
    method: 'get',
    params,
  })
}

export function getOrderListApi(params) {
  return request({
    url: '/material/getByPage',
    method: 'get',
    params,
  })
}

export function getDetailByNo(params) {
  return request({
    url: '/trade/getDetailByNo',
    method: 'get',
    params,
  })
}

export function takeOrder(params) {
  return request({
    url: '/trade/takeOrder',
    method: 'post',
    params,
    headers: { ['Content-Type']: 'application/json' },
  })
}
//订单详情接口
export function getByTradeNo(params) {
  return request({
    url: '/trade/getByTradeNo',
    method: 'get',
    params,
  })
}

export function getByPage(params) {
  return request({
    url: '/trade/getByPage',
    method: 'get',
    params,
  })
}

export function showSkuNum(params) {
  return request({
    url: '/tradeSend/showSkuNum',
    method: 'get',
    params,
  })
}

export function tradeSend(params, data) {
  return request({
    url: '/tradeSend/send',
    method: 'post',
    params,
    data,
  })
}

export function tradeLog(params) {
  return request({
    url: '/tradeSend/tradeLog',
    method: 'get',
    params,
  })
}

export function tradeLogSummary(params) {
  return request({
    url: '/tradeSend/tradeLogSummary',
    method: 'get',
    params,
  })
}

export function download(params) {
  return request({
    url: '/trade/contract/download',
    method: 'get',
    params,
    responseType: 'blob',
  })
}

export function getVideoApi(tradeId) {
  return request({
    url: '/trade/getVideo',
    method: 'get',
    params: { tradeId },
  })
}

export function archivedownload(params) {
  return request({
    url: '/trade/archive/download',
    method: 'get',
    params: params,
  })
}

export function token(params) {
  return request({
    url: '/trade/archive/token',
    method: 'get',
    params: params,
  })
}

export function pdf(params) {
  return request({
    url: '/trade/contract/pdf',
    method: 'post',
    data: params,
    responseType: 'blob',
  })
}

export function contract(params) {
  return request({
    url: '/trade/contract',
    method: 'get',
    params,
  })
}

export function save(params) {
  return request({
    url: '/trade/contract/save',
    method: 'post',
    data:params,
  })
}

export function viewRemarks(params) {
  return request({
    url: '/trade/viewRemarks',
    method: 'get',
    params,
  })
}

export function fillRemarks(params) {
  return request({
    url: '/trade/fillRemarks',
    method: 'get',
    params,
  })
}

// 获取标签列表
export function getLabelListApi() {
  return request({
    url: '/trade/getLabelList',
    method: 'get',
  })
}

// 获取订单日志
export function getLogListApi(tradeId) {
  return request({
    url: '/log/tradeLog',
    method: 'get',
    params: { tradeId },
  })
}
